CC=gcc
CFLAGS=-pipe -Wall -p -I..

TEST_UNITS=CuTest.o CuTestList.o CuTestAttrib.o CuTestDict.o CuTestPkg.o #CuTestPkgDb.o
UNITS=list.o attrib.o dict.o pkg.o #pkgdb.o

all: AllTests

AllTests: AllTests.o $(TEST_UNITS) $(UNITS)
	$(CC) *.o -o $@
	
CuTest.o: CuTest.c
	$(CC) $(CFLAGS) -c $<
	
CuTestList.o: CuTestList.c
	$(CC) $(CFLAGS) -c $<
list.o: ../list.c
	$(CC) $(CFLAGS) -c $< -o $@
	
CuTestAttrib.o: CuTestAttrib.c
	$(CC) $(CFLAGS) -c $<
attrib.o: ../attrib.c
	$(CC) $(CFLAGS) -c $< -o $@

CuTestDict.o: CuTestDict.c
	$(CC) $(CFLAGS) -c $<
dict.o: ../dict.c
	$(CC) $(CFLAGS) -c $< -o $@

CuTestPkg.o: CuTestPkg.c
	$(CC) $(CFLAGS) -c $<
pkg.o: ../pkg.c
	$(CC) $(CFLAGS) -c $< -o $@

CuTestPkgDb.o: CuTestPkgDb.c
	$(CC) $(CFLAGS) -c $<
pkgdb.o: ../pkgdb.c
	$(CC) $(CFLAGS) -c $< -o $@

AllTests.o: AllTests.c
	$(CC) $(CFLAGS) -c $<
	
AllTests.c: 
	 sh make-tests.sh > $@ 
	
clean:
	rm -rf AllTests* *.o
